#include <stdio.h>

//实现计算器基本功能---1
int main()
{
    printf("################\n");
    printf("#####0:exit####\n");
    printf("#####1:add#####\n");
    printf("#####2:sub#####\n");
    printf("#####3:div#####\n");
    printf("#####4:mul#####\n");
    int input = 0 ;

    int x = 0;
    int y = 0;//不考虑x和y特殊情况
    do {
        printf("select function\n");
        scanf("%d", &input);
        switch (input) {
            case 0:
                printf("exit\n");
                break;
            case 1:
                printf("input x & y:");
                scanf("%d %d",&x,&y);
                printf("%d\n",x+y);
                break;
            case 2:
                printf("input x & y:");
                scanf("%d %d",&x,&y);
                printf("%d\n",x-y);
                break;
            case 3://除法
                printf("input x & y:");
                scanf("%d %d",&x,&y);
                printf("%d\n",x/y);
                break;
            case 4://乘法
                printf("input x & y:");
                scanf("%d %d",&x,&y);
                printf("%d\n",x*y);
                break;
            default:
                printf("error input\n");
                break;

        }
    } while (input);
    return 0;
}